package cn.ryh.security.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Rao
 * @Description
 * @create 2022-04-13 13:21
 */
@Controller
public class RouterController {
    @RequestMapping({"/","/index"})
    public String index(){
        return "index";
    }

    @RequestMapping("/login")
    public String login(){
        return "views/login";
    }
    /*
     @RequestMapping("/logout")
     public String logout(){
         return "/logout";
     }
    */

    @RequestMapping("/level1/{id}")
    public String toLevel1(@PathVariable("id") int id){
        return String.format("views/level1/%d", id);
    }
    @RequestMapping("/level2/{id}")
    public String toLevel2(@PathVariable("id") int id){
        return String.format("views/level2/%d", id);
    }
    @RequestMapping("/level3/{id}")
    public String toLevel3(@PathVariable("id") int id){
        return String.format("views/level3/%d", id);
    }
}
